<template>
  <div class="settings-container">
    <h2 class="settings-title">设置中心</h2>
    <el-form
      :model="settingsForm"
      label-width="120px"
      class="settings-form"
      style="max-width: 460px;"
    >
      <el-form-item label="通知开关">
        <el-switch v-model="settingsForm.notification" active-text="开启" inactive-text="关闭"></el-switch>
      </el-form-item>
      <el-form-item label="主题颜色">
        <el-color-picker v-model="settingsForm.themeColor"></el-color-picker>
      </el-form-item>
      <el-form-item>
        <el-button type="primary" class="save-button" @click="saveSettings">保存设置</el-button>
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
export default {
  name: 'SettingsList',
  data() {
    return {
      settingsForm: {
        notification: true,
        themeColor: '#409EFF',
      },
    };
  },
  methods: {
    saveSettings() {
      console.log('Notification:', this.settingsForm.notification);
      console.log('Theme Color:', this.settingsForm.themeColor);
      this.$message({
        message: '设置已保存！',
        type: 'success',
      });
    },
  },
};
</script>

<style scoped>
.settings-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20px;
  background: linear-gradient(135deg, #f5f7fa, #c3cfe2);
  min-height: 100vh;
}

.settings-title {
  text-align: center;
  color: #333;
  margin-bottom: 20px;
  border-bottom: 2px solid #409EFF;
  padding-bottom: 10px;
}

.settings-form {
  background: #fff;
  padding: 20px;
  border-radius: 8px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.save-button {
  width: 100%;
  margin-top: 20px;
}
</style>